Skip to content

Remove redundant branch lookup in repository tree fetch path#168

Merged
naheel0 merged 5 commits into
mainfrom
copilot/fix-review-comment-3329122668
May 31, 2026
Merged

Remove redundant branch lookup in repository tree fetch path#168
naheel0 merged 5 commits into
mainfrom
copilot/fix-review-comment-3329122668

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

This PR addresses feedback on PR #166 to change only the referenced review comment: avoid an unconditional extra GitHub API request in the repository snapshot flow. The tree fetch path now uses the branch ref directly instead of pre-resolving branch metadata first.

  • Scope: targeted review-comment fix

    • Updated getRepoSnapshot in src/lib/octokit.ts to remove the repos.getBranch call and related tree SHA extraction/fallback logic.
    • Preserved existing behavior of fetching the tree via repoInfo.default_branch in git.getTree.
  • Net effect

    • Eliminates one REST request on successful repository lookups.
    • Keeps the change narrowly scoped to the reviewed concern with no additional behavioral expansion.
const { data: repoTree } = await client.rest.git.getTree({
  owner,
  repo,
  tree_sha: repoInfo.default_branch,
});

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
readme-gen-ai Ready Ready Preview, Comment May 30, 2026 6:27pm

Copilot AI changed the title [WIP] Fix code according to review comment 3329122668 Remove redundant branch lookup in repository tree fetch path May 30, 2026
Copilot AI requested a review from jaseel0 May 30, 2026 18:27
@naheel0 naheel0 marked this pull request as ready for review May 31, 2026 07:22
@naheel0 naheel0 merged commit 7d48e88 into main May 31, 2026
6 checks passed
@naheel0 naheel0 deleted the copilot/fix-review-comment-3329122668 branch May 31, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants